﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 水费管理系统
{
    public partial class 收费查询 : Form
    {
        public 收费查询()
        {
            InitializeComponent();
        }

        private void 收费BindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.收费BindingSource.EndEdit();
            this.收费TableAdapter.Update(this.dataSet1.收费);

        }

        private void 收费查询_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“dataSet1.收费”中。您可以根据需要移动或移除它。
            this.收费TableAdapter.Fill(this.dataSet1.收费);

        }

        private void fillBy用户单位ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.收费TableAdapter.FillBy用户单位(this.dataSet1.收费, 用户单位ToolStripTextBox.Text);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void fillBy户名ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.收费TableAdapter.FillBy户名(this.dataSet1.收费, 户名ToolStripTextBox.Text);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void fillBy日期ToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.收费TableAdapter.FillBy日期(this.dataSet1.收费, new System.Nullable<System.DateTime>(((System.DateTime)(System.Convert.ChangeType(交费日期ToolStripTextBox.Text, typeof(System.DateTime))))));
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            收费录入 sflr = new 收费录入();
            sflr.ShowDialog();
        }

        private void 收费DataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            打印 dy = new 打印(打印.id_打印类别.收费,Convert.ToInt32(收费DataGridView["ID",e.RowIndex].Value));
            dy.ShowDialog();
        }
    }
}